/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.insurance.cis.models;

import com.insurance.cis.daos.GroupDao;
import com.insurance.cis.daos.ModuleDao;
import java.util.Date;
import java.util.List;

/**
 *
 * @author TruongLQ
 */
public class Employee {
    String code;
    String userName, name, gender, password;
    Group group; // references to "id" column in group table: FK
    Date dob;
    List<Module> accessedModules;
    final GroupDao groupDao=new GroupDao();
    final ModuleDao moduleDao = new ModuleDao();
    
    public Employee(String code, String userName, String password, String name, 
            String gender, Date dob, int groupId) {
        this.code = code;
        this.userName = userName;
        this.password = password;
        this.name = name;
        this.gender = gender;
        this.group = groupDao.getGroupById(groupId);
        this.dob = dob;
        accessedModules = moduleDao.getModules(groupId);
    }

    public List<Module> getAccessedModules() {
        return accessedModules;
    }

    public Group getGroup() {
        return group;
    }

    public String getUserName() {
        return userName;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getGender() {
        return gender;
    }

    public Date getDob() {
        return dob;
    }

    public String getPassword() {
        return password;
    }

    public void setGroup(Group group) {
        this.group = group;
    }
    
}
